#include<iostream>
#include<string>
#include<algorithm>
using namespace std;

class Solution {
public:
    string replaceSpace(string s) {
        if(s.empty()){
            return "";
        }
        string temp(s.begin()+1,s.end());
        string result;
        if((*s.begin())==' '){
            result = "%20";
            
        }
        else{
            result = *s.begin(); 
            
        }
        return result+replaceSpace(temp);
    }
};